Skip to main content

Math functions

Math functions

FUNCTIONDESCRIPTIONSYNTAX
AbsReturns the absolute value of a number (integer, currency, real, float).
Abs(1.5) -> 1.5
Abs(-1.5) -> 1.5
The parameter can be XPath, variable, or number.
CHelper.Math.Abs(Number)
AverageObtains the average (arithmetic mean) of a set of numbers (integer, currency, real, float).
The parameters can be XPaths, variables, or numbers, and have to be between brackets.
CHelper.Math.Average([Number1, Number2, ......])
CeilingRounds a number (integer, currency, real, float) up to the nearest integer.
Ceiling(1.2) -> 2
Ceiling(1.9) -> 2
The parameter can be XPath, variable, or number.
CHelper.Math.Ceiling(Number)
ExpReturns e (the base of natural logarithms) raised to the given power.
The parameter can be XPath, variable, or number.
THE RESULT OF THIS FUNCTION MUST BE STORED IN A FLOAT-TYPE ATTRIBUTE.
CHelper.Math.Exp(Number)
FloorRounds a number (integer, currency, real, float) down to the nearest integer.
Floor(1.2) -> 1
Floor(1.9) -> 1
The parameter can be XPath, variable, or number.
CHelper.Math.Floor(Number)
IsNaNThis function checks if a parameter is not a number:
• Returns true if the parameter is not a number.
• Returns false if the parameter is a number.
The parameter can be XPath, variable, or number.
CHelper.Math.IsNaN(Parameter)
LnReturns the natural logarithm of a number (integer, currency, real, float).
The parameter can be XPath, variable, or number.
CHelper.Math.Ln(Number)
Log10Returns the base 10 logarithm of a number.
The parameter can be XPath, variable, or number.
CHelper.Math.Log10(Number)
MaxReturns the largest value of a set of numbers (integer, currency, real, float).
The parameters can be XPaths, variables, or numbers, and have to be between brackets.
CHelper.Math.Max([Number1, Number2])
MinReturns the smallest value of a set of numbers (integer, currency, real, float).
The parameters can be XPaths, variables, or numbers, and have to be between brackets.
CHelper.Math.Min([Number1, Number2])
ModuleReturns the remainder after a number is divided by a divisor.
Mod(8,3) -> 2
Mod(10,2) -> 0
The parameters can be XPaths, variables, or numbers and must be integers.
CHelper.Math.Module(Number, Divisor)
PercentageReturns the equivalent in percentage of a number (integer, currency, real, float).
Percentage(100) -> 1
Percentage(75) -> 0.75
The parameter can be XPath, variable, or number.
CHelper.Math.Percentage(Number)
PowObtains the result of a number raised to a power.
The parameters can be XPaths, variables, or numbers.
CHelper.Math.Pow(Base, Power)
QuotientReturns the integer portion of a division.
Quotient(100,3) -> 33
Quotient(5,2) -> 2
The parameters can be XPaths, variables, or numbers and must be integers.
CHelper.Math.Quotient(Number, Divisor)
Rand(from,to)Returns an integer random number between two numbers.
The parameters can be XPaths, variables, or numbers and must be integers.
CHelper.Math.Rand(ValueFrom, ValueTo)
RandWhen the function has empty parameters it returns a decimal random number between 0.0 to 1.0.CHelper.Math.Rand()
Round(number, decimal)Reduces a given number (integer, currency, real, float) to a specific number of decimal places (integer).
Round(1.247, 2) -> 1.25
Round(1.534, 1) -> 1.5
The parameters can be XPaths, variables, or numbers.
CHelper.Math.Round(Number, DecimalPlaces)
Round(number)Reduces a given number (integer, currency, real, float) to an integer without decimal places.
Round(1.247) -> 1
Round(1.534) -> 2
The parameters can be XPaths, variables, or numbers.
CHelper.Math.Round(Number)
SqrtObtains the square root of a number (integer, currency, real, float).CHelper.Math.Sqrt(Number)
TruncateTruncates a number (integer, currency, real, float) to an integer by removing its decimal or fractional part.
Truncate(35.5) -> 35
Truncate(35.89) -> 35
The parameter can be XPath, variable, or number.
CHelper.Math.Truncate(Number)